//WdgText.cpp
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include "WdgText.hpp"
#include "dislin.h"

using namespace wdgpp;

WdgText::WdgText(const std::string &str): _str(str)
{
}

std::string WdgText::get_text() const
{
   return ""; //gwgtxt(get_id());
}

int WdgText::get_int() const
{
   return gwgint(get_id());
}

float WdgText::get_float() const
{
   return gwgflt(get_id());
}

void WdgText::set_text(const std::string &str)
{
   swgtxt(get_id(), (_str = str).c_str());
}

void WdgText::set_int(int i)
{
   swgint(get_id(), i);
}

void WdgText::set_float(float f, int nd)
{
   swgflt(get_id(), f, nd);
}

int WdgText::create(int ip)
{
   return wgtxt(ip, _str.c_str());
}

